@extends('backend.layouts.master')


@section('content')
    <div class="container-fluid">
            <div class="row clearfix">
                    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                        <div class="card">
                            <div class="header">
                                <h2>
                                    角色管理
                                </h2>
                                <ul class="header-dropdown m-r--5">
                                    <li>
                                        <a href="{{route('admin.role.create')}}" class="btn btn-wave btn-info">添加新角色</a>
                                    </li>
                                </ul>
                            </div>
                            <div class="body table-responsive">
                                <table class="table">
                                    <thead>
                                        <tr>
                                            <th>#</th>
                                            <th>角色名称</th>
                                            <th>所属Guard</th>
                                            <th>添加时间</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        @forelse($roles as $role)
                                            <tr>
                                                <th scope="row">{{$role->id}}</th>
                                                <td>{{$role->name}}</td>
                                                <td>{{$role->guard_name}}</td>
                                                <td>{{$role->created_at}}</td>
                                                <td>
                                                    <a href="{{route('admin.role.edit', $role->id)}}" class="btn bg-light-blue waves-effect">修改</a>
                                                    <a href="#" class="btn btn-danger waves-effect">删除</a>
                                                    <a href="#" class="btn bg-pink waves-effect">角色权限</a>
                                                </td>
                                            </tr>

                                            @empty

                                            <tr> <td colspan="4">无角色</td></tr>
                                        @endforelse
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
    </div>
@endsection